home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_bas / t2win_32.zip / _REGISTR.FRM < prev    next >
Text File  |  1996-05-14  |  8KB  |  249 lines

  1. VERSION 4.00
  2. Begin VB.Form frmRegistry 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Registry"
  5.    ClientHeight    =   4845
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3270
  8.    ClientWidth     =   7485
  9.    Height          =   5250
  10.    Left            =   1830
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   4845
  14.    ScaleWidth      =   7485
  15.    ShowInTaskbar   =   0   'False
  16.    Top             =   2925
  17.    Width           =   7605
  18.    Begin VB.TextBox txt_Result 
  19.       BackColor       =   &H00C0C0C0&
  20.       BorderStyle     =   0  'None
  21.       Height          =   4110
  22.       Left            =   105
  23.       Locked          =   -1  'True
  24.       MultiLine       =   -1  'True
  25.       ScrollBars      =   2  'Vertical
  26.       TabIndex        =   6
  27.       Top             =   630
  28.       Width           =   7260
  29.    End
  30.    Begin Threed.SSPanel SSPanel1 
  31.       Align           =   1  'Align Top
  32.       Height          =   480
  33.       Left            =   0
  34.       TabIndex        =   0
  35.       Top             =   0
  36.       Width           =   7485
  37.       _Version        =   65536
  38.       _ExtentX        =   13203
  39.       _ExtentY        =   847
  40.       _StockProps     =   15
  41.       ForeColor       =   -2147483640
  42.       BackColor       =   12632256
  43.       Begin VB.ComboBox cmb_Function 
  44.          Height          =   315
  45.          Left            =   1365
  46.          TabIndex        =   1
  47.          Top             =   90
  48.          Width           =   4785
  49.       End
  50.       Begin Threed.SSCommand cmdNP 
  51.          Height          =   300
  52.          Index           =   1
  53.          Left            =   7140
  54.          TabIndex        =   5
  55.          Top             =   90
  56.          Width           =   255
  57.          _Version        =   65536
  58.          _ExtentX        =   450
  59.          _ExtentY        =   529
  60.          _StockProps     =   78
  61.          Caption         =   ">"
  62.          BevelWidth      =   1
  63.          Font3D          =   3
  64.          RoundedCorners  =   0   'False
  65.          Outline         =   0   'False
  66.       End
  67.       Begin Threed.SSCommand cmdNP 
  68.          Height          =   300
  69.          Index           =   0
  70.          Left            =   6300
  71.          TabIndex        =   4
  72.          Top             =   90
  73.          Width           =   255
  74.          _Version        =   65536
  75.          _ExtentX        =   450
  76.          _ExtentY        =   529
  77.          _StockProps     =   78
  78.          Caption         =   "<"
  79.          BevelWidth      =   1
  80.          Font3D          =   3
  81.          RoundedCorners  =   0   'False
  82.          Outline         =   0   'False
  83.       End
  84.       Begin VB.Label Label2 
  85.          Caption         =   "&Select a function"
  86.          Height          =   255
  87.          Left            =   90
  88.          TabIndex        =   3
  89.          Top             =   120
  90.          Width           =   1275
  91.       End
  92.       Begin Threed.SSCommand SSCommand1 
  93.          Default         =   -1  'True
  94.          Height          =   300
  95.          Left            =   6615
  96.          TabIndex        =   2
  97.          Top             =   90
  98.          Width           =   465
  99.          _Version        =   65536
  100.          _ExtentX        =   820
  101.          _ExtentY        =   529
  102.          _StockProps     =   78
  103.          Caption         =   "&Go"
  104.          BevelWidth      =   1
  105.          RoundedCorners  =   0   'False
  106.          Outline         =   0   'False
  107.       End
  108.    End
  109. End
  110. Attribute VB_Name = "frmRegistry"
  111. Attribute VB_Creatable = False
  112. Attribute VB_Exposed = False
  113. Option Explicit
  114. Option Base 1
  115.  
  116. Private Const Iteration = 250
  117.  
  118. Dim IsLoaded         As Integer
  119.  
  120. Dim TimerStartOk     As Integer
  121. Dim TimerCloseOk     As Integer
  122.  
  123. Dim TimerHandle      As Integer
  124. Dim TimerValue       As Long
  125.  
  126. Private Sub cmdNP_Click(Index As Integer)
  127.  
  128.    Call sub_NextPrev(cmb_Function, Index)
  129.  
  130. End Sub
  131.  
  132.  
  133. Private Sub cmb_Function_Click()
  134.    
  135.    If (IsLoaded = False) Then Exit Sub
  136.    
  137.    Call cDisableFI(mdiT2W.Picture1)
  138.    
  139.    txt_Result = ""
  140.    
  141.    DoEvents
  142.    
  143.    Select Case cmb_Function.ListIndex
  144.       Case 0
  145.          Call TestRegistry
  146.    End Select
  147.  
  148.    DoEvents
  149.    Call cEnableFI(mdiT2W.Picture1)
  150.    
  151. End Sub
  152.  
  153.  
  154. Private Sub Form_Activate()
  155.  
  156.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  157.  
  158. End Sub
  159.  
  160. Private Sub Form_Load()
  161.  
  162.    IsLoaded = False
  163.    
  164.    Show
  165.  
  166.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_registr.t2w")
  167.    
  168.    IsLoaded = True
  169.    
  170. End Sub
  171.  
  172.  
  173. Private Sub SSCommand1_Click()
  174.    
  175.    Call cmb_Function_Click
  176.    
  177. End Sub
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185. Private Sub TestRegistry()
  186.  
  187.    Dim intResult        As Integer
  188.    Dim strResult        As String
  189.    Dim strDisplay       As String
  190.    
  191.    Dim Section1         As String
  192.    Dim Section2         As String
  193.    
  194.    Dim i                As Integer
  195.    
  196.    strResult = ""
  197.    strDisplay = ""
  198.    
  199.    Section1 = "under the fox"
  200.    Section2 = "software\The MCR Company\TIME TO WIN for VB 4.0"
  201.    
  202.    strDisplay = strDisplay & "Use section '" & Section1 & "'" & vbCrLf & vbCrLf
  203.    
  204.    strDisplay = strDisplay & "Setting default value to 'no key' is '" & cPutRegistry(Section1, "", "no key") & "'" & vbCrLf
  205.    strDisplay = strDisplay & "Setting value of key 'key1' to 'test key 1' is '" & cPutRegistry(Section1, "key1", "test key 1") & "'" & vbCrLf
  206.    strDisplay = strDisplay & "Setting value of key 'key2' to 'test key 2' is '" & cPutRegistry(Section1, "key2", "test key 2") & "'" & vbCrLf & vbCrLf
  207.    
  208.    strDisplay = strDisplay & "Getting default value is '" & cGetRegistry(Section1, "", "?") & "'" & vbCrLf
  209.    strDisplay = strDisplay & "Getting value of key 'key2' is '" & cGetRegistry(Section1, "key2", "?") & "'" & vbCrLf
  210.    strDisplay = strDisplay & "Getting value of key 'key1' is '" & cGetRegistry(Section1, "key1", "?") & "'" & vbCrLf & vbCrLf
  211.    
  212.    strDisplay = strDisplay & "Use section '" & Section2 & "'" & vbCrLf & vbCrLf
  213.    
  214.    strDisplay = strDisplay & "Setting default value to 'License information' is '" & cPutRegistry(Section2, "", "License information") & "'" & vbCrLf
  215.    strDisplay = strDisplay & "Setting value of key 'Name' to 'James' is '" & cPutRegistry(Section2, "Name", "James") & "'" & vbCrLf
  216.    strDisplay = strDisplay & "Setting value of key 'Id' to 'Donb' is '" & cPutRegistry(Section2, "Id", "Donb") & "'" & vbCrLf
  217.    strDisplay = strDisplay & "Setting value of key 'N░' to '007' is '" & cPutRegistry(Section2, "N░", "007") & "'" & vbCrLf & vbCrLf
  218.    
  219.    strDisplay = strDisplay & "Getting default value is '" & cGetRegistry(Section2, "", "?") & "'" & vbCrLf
  220.    strDisplay = strDisplay & "Getting value of key 'Name' is '" & cGetRegistry(Section2, "Name", "?") & "'" & vbCrLf
  221.    strDisplay = strDisplay & "Getting value of key 'Id' is '" & cGetRegistry(Section2, "Id", "?") & "'" & vbCrLf
  222.    strDisplay = strDisplay & "Getting value of key 'N░' is '" & cGetRegistry(Section2, "N░", "?") & "'" & vbCrLf & vbCrLf
  223.    
  224.    strDisplay = strDisplay & "Kill Section 'under the fox' is '" & cKillRegistry(Section1, "") & "'" & vbCrLf & vbCrLf
  225.    strDisplay = strDisplay & "Kill Section 'software\The MCR Company' is '" & cKillRegistry("software\The MCR Company", "") & "'" & vbCrLf & vbCrLf
  226.    
  227.    txt_Result = strDisplay
  228.    
  229.    'time the function
  230.  
  231.    intResult = cPutRegistry(Section2, "Name", "James")
  232.  
  233.    TimerHandle = cTimerOpen()
  234.    TimerStartOk = cTimerStart(TimerHandle)
  235.    
  236.    For i = 1 To Iteration
  237.       strResult = cGetRegistry(Section2, "", "?1")
  238.    Next i
  239.    
  240.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  241.    
  242.    TimerCloseOk = cTimerClose(TimerHandle)
  243.    
  244.    intResult = cKillRegistry("software\The MCR Company", "")
  245.  
  246. End Sub
  247.  
  248.  
  249.